function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
import ELNode from "../node";
import { NodeTypeEnum } from "../../constant";

/**
 * 操作符中结束节点的模型（作为操作符模型的代理），
 * 操作符包括WHEN、SWITCH、IF、FOR、WHILE、CATCH、AND、OR、NOT等等。
 */
var ELEndNode = /*#__PURE__*/function (_ELNode) {
  _inherits(ELEndNode, _ELNode);
  var _super = _createSuper(ELEndNode);
  function ELEndNode(proxy) {
    var _this;
    _classCallCheck(this, ELEndNode);
    _this = _super.call(this);
    _defineProperty(_assertThisInitialized(_this), "type", NodeTypeEnum.VIRTUAL);
    /** 代理的节点组件 */
    _defineProperty(_assertThisInitialized(_this), "proxy", void 0);
    /** 代理节点组件的相关属性 */
    _defineProperty(_assertThisInitialized(_this), "parent", void 0);
    _this.proxy = proxy;
    _this.parent = proxy.parent;
    return _this;
  }

  /**
   * 在结束节点的前面、插入新节点
   * @param newNode 新节点
   * @returns
   */
  _createClass(ELEndNode, [{
    key: "prepend",
    value: function prepend(newNode) {
      return this.proxy.appendChild(newNode);
    }

    /**
     * 在结束节点的后面、插入新节点
     * @param newNode 新节点
     * @returns
     */
  }, {
    key: "append",
    value: function append(newNode) {
      return this.proxy.append(newNode);
    }

    /**
     * 删除结束节点
     */
  }, {
    key: "remove",
    value: function remove() {
      return this.proxy.remove();
    }

    /**
     * 替换当前节点为新节点
     * @param newNode 新节点
     * @returns
     */
  }, {
    key: "replace",
    value: function replace(newNode) {
      return this.proxy.replace(newNode);
    }

    /**
     * 转换为X6的图数据格式
     */
  }, {
    key: "toCells",
    value: function toCells() {
      throw new Error('Method not implemented.');
    }

    /**
     * 获取当前X6 Cell内容
     */
  }, {
    key: "getCells",
    value: function getCells() {
      return this.proxy.getCells();
    }

    /**
     * 获取当前X6 节点内容
     */
  }, {
    key: "getNodes",
    value: function getNodes() {
      return this.proxy.getNodes();
    }

    /**
     * 获取当前节点的开始节点
     */
  }, {
    key: "getStartNode",
    value: function getStartNode() {
      return this.proxy.getStartNode();
    }

    /**
     * 获取当前节点的结束节点
     */
  }, {
    key: "getEndNode",
    value: function getEndNode() {
      return this.proxy.getEndNode();
    }

    /**
     * 获取属性
     * @returns 属性
     */
  }, {
    key: "getProperties",
    value: function getProperties() {
      return this.proxy.getProperties();
    }

    /**
     * 设置属性
     */
  }, {
    key: "setProperties",
    value: function setProperties(properties) {
      this.proxy.setProperties(properties);
    }

    /**
     * 获取属性的EL表达式
     * @returns 属性的EL表达式
     */
  }, {
    key: "propertiesToEL",
    value: function propertiesToEL() {
      return this.proxy.propertiesToEL();
    }

    /**
     * 转换为EL表达式字符串
     */
  }, {
    key: "toEL",
    value: function toEL(prefix) {
      return this.proxy.toEL(prefix);
    }

    /**
     * 转换为JSON格式
     */
  }, {
    key: "toJSON",
    value: function toJSON() {
      return this.proxy.toJSON();
    }

    /**
     * 是否折叠
     */
  }, {
    key: "isCollapsed",
    value: function isCollapsed() {
      return this.proxy.isCollapsed();
    }

    /**
     * 折叠：展开、收起
     */
  }, {
    key: "toggleCollapse",
    value: function toggleCollapse(collapsed) {
      this.proxy.toggleCollapse(collapsed);
    }
  }]);
  return ELEndNode;
}(ELNode);
export { ELEndNode as default };